#pragma once

#include "ScriptCompiler/AST/ASTNode.h"

class CScriptToken;
class CExpressionNode;
class CSetAccessorNode;
class CGetAccessorNode;
class CAccessLevelNode;
class CTypeNode;
class CDecoratorNode;
class CPropertyIndexerNode;

class CPropertyNode : public CASTNode
{
public:
    CPropertyNode(std::weak_ptr<CScriptFileContext> InFile)
        : CASTNode( InFile,EASTNodeType::Property)
    {
    }

    //property type
    std::shared_ptr<CTypeNode> Type;

    //property name, might be This if it is a indexer
    std::shared_ptr<CScriptToken> Name;

    //indexer
    TOptional<std::shared_ptr<CPropertyIndexerNode>> Indexer;


    //property access level
    TOptional<std::shared_ptr<CAccessLevelNode>> AccessLevel;

    //decorator 
    TOptional<std::shared_ptr<CDecoratorNode>> Decorator;

    //property getter
    TOptional<std::shared_ptr<CGetAccessorNode>> Getter;

    //property setter
    TOptional<std::shared_ptr<CSetAccessorNode>> Setter;

    //property default value , like : int32_t a => 1;
    TOptional<std::shared_ptr<CExpressionNode>> DefaultValue;


    virtual void DebugPrint(int32_t InDepth) override;

    virtual std::shared_ptr<CScriptToken> GetFirstToken() override;
};